import java.io.IOException;
import java.net.SocketException;
import java.util.HashMap;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 666
 * Date: 2023-04-05
 * Time: 9:57
 */
public class UdpServer extends UdpEchoServer{
    Map<String,String> map = new HashMap<>();

    public UdpServer(int port) throws SocketException {
        super(port);

        map.put("cat","猫");
        map.put("dog","狗");
        map.put("bit","比特");
    }
@Override
public String process( String str){
        return  map.getOrDefault(str,"没找到");
}
    public static void main(String[] args) throws IOException {
        UdpServer udpServer = new UdpServer(6666);
        udpServer.start();
    }
}
